import { ApiResponse,HttpListResp } from '@/types/http.d';
import { default as axios } from '@/utils/request';

/**
 * 职位相关接口
 */
class PositionService {
  // 职位详情
  static selectHrJobInfo<T = any>(jobId: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/job/${jobId}`,
      // url: `/seeker-web/v1/selectHrJobInfo`,
      method: 'get',
      
    });
  }
  // static collectJob<T = any>(id: string | string[]) {
  //   return axios<ApiResponse<T>>({
  //     url: `/seeker-web/v1/collectJob?jobId=${id}`,
  //     method: 'post',
  //   });
  // }
  static collectJob<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/collectJob`,
      method: 'post',
      params,
    });
  }

  static collectJob2<T = any>(id: string | string[]) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/collectJob?jobId=${id}`,
      method: 'post',
    });
  }
  static cancelCollectJob<T = any>(id: string | string[]) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/cancelCollectJob?jobId=${id}`,
      method: 'post',
    });
  }

  // 校园招聘-精选职位
  static selectMostSendJob<T = any>(params: any) {
    return axios<ApiResponse<HttpListResp<T>>>({
      url: `/seeker-web/v1/selectMostSendJob`,
      method: 'get',
      params,
    });
  }

  // 校园招聘-校招企业
  static selectCompanyByJob<T = any>(params: any) {
    return axios<ApiResponse<HttpListResp<T>>>({
      url: `/seeker-web/v1/selectCompanyByJob`,
      method: 'get',
      params,
    });
  }

  // 查询不同类别招聘会
  static selectJobFairsByType<T = any>(params: any) {
    return axios<ApiResponse<HttpListResp<T>>>({
      url: `/seeker-web/v1/selectJobFairsByType`,
      method: 'get',
      params,
    });
  }
  // 查询招聘会
  static selectSchoolRecruitPass<T = any>(params: any) {
    return axios<ApiResponse<HttpListResp<T>>>({
      url: `/seeker-web/v1/selectSchoolRecruitPass`,
      method: 'get',
      params,
    });
  }

  // 根据招聘会ID查询招聘会下职位信息
  static selectFairsPositionList<T = any>(params: any) {
    return axios<ApiResponse<HttpListResp<T>>>({
      url: `/seeker-web/v1/selectFairsPositionList`,
      method: 'get',
      params,
    });
  }

  // 根据招聘会ID查询招聘会详情
  static selectJobFairsDetail<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/selectJobFairsDetail`,
      method: 'get',
      params,
    });
  }
  // 查询校招活动的岗位
  static getSchoolRecruitJob<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/getSchoolRecruitJob`,
      method: 'get',
      params,
    });
  }

  // 查询校招活动详情
  static selectSchoolRecruitDetail<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/selectSchoolRecruitDetail`,
      method: 'get',
      params,
    });
  }

  // 根据招聘会ID 查询该招聘会下所有的企业
  static selectJobFairsCompanyList<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/selectJobFairsCompanyList`,
      method: 'get',
      params,
    });
  }
  // 查询校招活动的企业
  static getSchoolRecruitCompanyList<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/getSchoolRecruitCompanyList`,
      method: 'get',
      params,
    });
  }

  // 校园招聘轮播图列表
  static getBannerInformationOfSchoole<T = any>() {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/getBannerInformationOfSchoole`,
      method: 'get',
    });
  }

  //查询职位数量
  static selectJobSum<T = any>(params: any) {
    return axios<ApiResponse<T>>({
      url: `/seeker-web/v1/selectJobSum`,
      method: 'get',
      params,
    });
  }
}

export default PositionService;
